package com.example.studyroom.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.studyroom.Entity.StudyRoomAdmin;
import com.example.studyroom.mapper.StudyRoomAdminMapper;
import com.example.studyroom.service.StudyRoomAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudyRoomAdminServiceImpl extends ServiceImpl<StudyRoomAdminMapper, StudyRoomAdmin> implements StudyRoomAdminService {
    @Override
    public StudyRoomAdmin findByStudyRoomAdminLogin(String rname,String rpass) {
        return baseMapper.findByStudyRoomAdminLogin(rname,rpass);
    }

    @Autowired
    private StudyRoomAdminMapper studyRoomAdminMapper;

    @Override
    public List<StudyRoomAdmin> getAllStudyRoomAdmins() {
        return studyRoomAdminMapper.getAllStudyRoomAdmins();
    }

    @Override
    public void addStudyRoomAdmin(StudyRoomAdmin StudyRoomAdmin) {
        baseMapper.addStudyRoomAdmin(StudyRoomAdmin);
    }

    @Override
    public void deleteStudyRoomAdmin(Integer rid) {
        studyRoomAdminMapper.deleteStudyRoomAdmin(rid);
    }

    @Override
    public void modifyStudyRoomAdmin(StudyRoomAdmin studyRoomAdmin) {
        studyRoomAdminMapper.modifyStudyRoomAdmin(studyRoomAdmin);
    }
}
